//
//  AXFBalanceVC.m
//  BEEQUICK
//
//  Created by admin on 19/11/2016.
//  Copyright © 2016 SevenGroup. All rights reserved.
//

#import "AXFBalanceVC.h"
#import "AXFWhiteNavView.h"

@interface AXFBalanceVC ()<AXFWhiteNavViewDelegate>

@end

@implementation AXFBalanceVC

- (void)viewDidLoad {
	[super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
//    self.navigationController.navigationBar.hidden = NO;
}

- (void)setupUI {
    
    self.navigationItem.title = @"我的余额";
    
	UIView *totalAssetsView = [self setupViewWithBackgroundColor:0xffffff];
	UIView *infoView = [self setupViewWithBackgroundColor:0xefefef];
	UILabel *assetsLabel = [UILabel lr_labelWithText:@"总资产" fontSize:12 color:0x999999	];
	UILabel *balanceLabel = [UILabel lr_labelWithText:@"¥ 0.00" fontSize:22 color:0xff4400];
	UIImageView *walletImageView = [[UIImageView alloc] init];
	UILabel *infoLabel = [UILabel lr_labelWithText:@"暂无信息" fontSize:12 color:0x999999];
	
	[self.view addSubview:totalAssetsView];
	[self.view addSubview:infoView];
	[self.view addSubview:assetsLabel];
	[self.view addSubview:balanceLabel];
	[self.view addSubview:walletImageView];
	[self.view addSubview:infoLabel];
	
	walletImageView.image = [UIImage imageNamed:@"balance_empty"];
	[walletImageView sizeToFit];
	
	[totalAssetsView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.equalTo(self.view);
		make.height.mas_equalTo(120);
		make.left.offset(0);
		make.top.equalTo(self.mas_topLayoutGuide).offset(kNAVBARH);
	}];
	
	[infoView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(totalAssetsView);
		make.top.equalTo(totalAssetsView.mas_bottom);
		make.bottom.offset(0);
		make.width.equalTo(self.view);
	}];
	
	[assetsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.centerX.offset(0);
		make.top.equalTo(totalAssetsView.mas_top).offset(38);
	}];
	
	[balanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.centerX.equalTo(assetsLabel);
		make.top.equalTo(assetsLabel.mas_bottom).offset(20);
	}];
	
	[walletImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.centerX.equalTo(assetsLabel);
		make.top.equalTo(infoView.mas_top).offset(117);
	}];
	
	[infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.centerX.equalTo(assetsLabel);
		make.top.equalTo(walletImageView.mas_bottom).offset(34);
	}];
	
	
	AXFWhiteNavView *whiteNavView = [[AXFWhiteNavView alloc] init];
	
	[whiteNavView setTitleName:@"我的余额" andFunctionName:nil];
	
	whiteNavView.delegate = self;
	
	[self.view addSubview:whiteNavView];
	
	[whiteNavView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.right.top.offset(0);
		make.height.mas_equalTo(kNAVBARH + 20);
	}];
}

- (void)backToViewController {
	[self.navigationController popViewControllerAnimated:YES];
}

- (UIView *)setupViewWithBackgroundColor:(uint32_t)backgroundColor {
	UIView *view = [[UIView alloc] init];
	
	view.backgroundColor = [UIColor cz_colorWithHex:backgroundColor];
	return view;
}

- (void)didReceiveMemoryWarning {
	[super didReceiveMemoryWarning];
	// Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
